﻿var myv = new Vue({
    el: "#homeDiv",
    data: {
        announcement: [],
        NewRelease: [],
        CommodityType: [],
        CommodityInfo: []
    }
});

$(function () {
    $(".windowsHomePage div").click(function () {
        $(".windowsHomeBut").toggleClass("windowsHomeBut");
        $(this).toggleClass("windowsHomeBut");
        //全部关闭
        $(".windowsHomeText").css("visibility", "hidden");
        //打开当前
        $(".windowsHomeText").eq($(this).index()).css("visibility", "visible");
    });

   
    $("#commodityList").on("click", ".commodityOne", function () {
        location = "/GMShop/CommodityInfo?Cid=" + $(this).attr("id");
    });


    (function () {
        $.post("/GMShopMethod/Announcement", {}, function (data) {
            myv.$data.announcement = data;
        })
    })();

    (function () {
        $.post("/GMShopMethod/NewRelease", {}, function (data) {
            myv.$data.NewRelease = data;
        })
    })();

    (function () {
        $.post("/GMShopMethod/CommodityType", {}, function (data) {
            myv.$data.CommodityType = data;
        })
    })();

    (function () {
        $.post("/GMShopMethod/CommodityInfo", {}, function (data) {
            myv.$data.CommodityInfo = data;
        })
    })();
})
